<template>
	<view v-if="showFlag" class="uni-margin-wrap">
		<swiper class="swiper" >
			<swiper-item v-for="item in data">
				<view class="lb" :style="{backgroundImage:'url('+config.IMG_URL+item.img+')'}"></view>
				
			</swiper-item>
		</swiper>
	</view>
	<view v-else class="gjp"></view>
</template>

<script setup>
	import {ref,defineProps,watch} from "vue"
	import config from "../../../config"
	const props = defineProps({
		data:{
			type:String,
			default:[]
		}
	})
	const showFlag =ref(false)
	watch(()=>props.data.length,()=>{
		console.log(props.data.length)
		if(props.data.length>0){
			showFlag.value=true
		}else{
			showFlag.value=false
		}
		
	},{
		immediate:true
	})
	
</script>

<style scoped>
	.swiper{
		height: 300rpx;
		background-color: aqua;
	}
	.gjp{
		background-color: azure;
		height: 300rpx;
	}
	.lb{
		width: 100%;
		height: 300rpx;
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
</style>